<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Login Page</title>
</head>
<body>
<div th:if="${not #strings.isEmpty(success)}" th:text="${success}"></div>
<div th:if="${not #strings.isEmpty(error)}" th:text="${error}"></div>
<form action="/userlogin1" method="post" th:object="${user}">
    账号：<input type="text" name="username" th:field="*{name}"> <!-- 确保th:field语法正确 -->
    密码：<input type="password" name="password" th:field="*{password}"> <!-- 确保th:field语法正确 -->
    性别：<input type="text" name="sex" th:field="*{sex}"> <!-- 确保th:field语法正确 -->
    <input type="submit" value="登录">
</form>
</body>
</html>